import request from '@/utils/request'

// 文件上传
export function uploadFile(file){
  return request({
    url: '/house/housing/upload' + file,
    method: 'get'
  })
}

// 根据城市查询地铁
export function searchMetro(id){
  return request({
    url: '/house/metro/queryMetroListById/' + id,
    method: 'get'
  })
}

// 查询省市区
export function searchRegion(id){
  return request({
    url: '/house/region/queryRegionListById/' + id,
    method: 'get'
  })
}

// 查询楼盘列表
export function listHousing(query) {
  return request({
    url: '/house/housing/list',
    method: 'get',
    params: query
  })
}

// 查询楼盘详细
export function getHousing(id) {
  return request({
    url: '/house/housing/' + id,
    method: 'get'
  })
}

// 新增楼盘
export function addHousing(data) {
  return request({
    url: '/house/housing',
    method: 'post',
    data: data
  })
}

// 修改楼盘
export function updateHousing(data) {
  return request({
    url: '/house/housing',
    method: 'put',
    data: data
  })
}

// 删除楼盘
export function delHousing(id) {
  return request({
    url: '/house/housing/' + id,
    method: 'delete'
  })
}
